# Contributor: Michał Polański <michal@polanski.me>
# Maintainer:
pkgname=usbguard-notifier
pkgver=0.1.0
pkgrel=0
pkgdesc="Notifies on USBGuard policy and device presence changes"
url="https://github.com/Cropi/usbguard-notifier"
license="GPL-2.0-or-later"
arch="all"
makedepends="
	autoconf
	automake
	libtool
	usbguard-dev
	librsvg-dev
	libnotify-dev
	catch2
	asciidoc
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Cropi/usbguard-notifier/archive/usbguard-notifier-$pkgver.tar.gz
	no-systemd.patch"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

prepare() {
	default_prepare
	sed -i "s#/usr/include/catch#/usr/include/catch2#g" configure.ac
	autoreconf -fiv
}

check() {
	make check
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	make install DESTDIR="$pkgdir"
}

sha512sums="
709afccec9fdc94d4cd1f2f941b6819c3b353dc2f60beeb12791cc9e3dfe9ad6e9d00664c3e5d5979b5d454374b1a633362f0de6513a767b3b6e2b6d2196eb6c  usbguard-notifier-0.1.0.tar.gz
09ca4890884d0a62d1b152c6cc5120c9856f46b778cba6f3d36a831ad6f0e5e6651e4e5532e8cefbc55583b862af4c649e6299591fed66b4c9187f7e4f363f85  no-systemd.patch
"
